package router

import (
	"github.com/gin-gonic/gin"
	"net/http"
	"wwgin/module/response"
)

//其他的路由,比如404页面,/favicon.ico 等

func InitOtherRouter(r *gin.Engine) {
	r.GET("/favicon.ico", func(c *gin.Context) {
		c.Header("Cache-Control", "max-age=60")
		c.Header("Content-Type", "text/html")
		c.String(http.StatusOK, "")
		return
	})
	//404页面
	r.NoRoute(func(c *gin.Context) {
		response.ReturnJson(c, http.StatusNotFound, 404, "没有找到对应的页面,请检查地址后重试", gin.H{})
		return
	})
}
